3.1080 \(\int \frac {(c+d \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx\)

Optimal. Leaf size=129 \[ \frac {x \left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right )}{2 a}-\frac {d^2 (c+3 i d) \tan (e+f x)}{2 a f}+\frac {d^2 (-d+3 i c) \log (\cos (e+f x))}{a f}+\frac {(-d+i c) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))} \]

[Out]

1/2*(c^3-3*I*c^2*d+3*c*d^2+3*I*d^3)*x/a+(3*I*c-d)*d^2*ln(cos(f*x+e))/a/f-1/2*(c+3*I*d)*d^2*tan(f*x+e)/a/f+1/2*
(I*c-d)*(c+d*tan(f*x+e))^2/f/(a+I*a*tan(f*x+e))

________________________________________________________________________________________

Rubi [A]  time = 0.16, antiderivative size = 129, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {3550, 3525, 3475} \[ \frac {x \left (-3 i c^2 d+c^3+3 c d^2+3 i d^3\right )}{2 a}-\frac {d^2 (c+3 i d) \tan (e+f x)}{2 a f}+\frac {d^2 (-d+3 i c) \log (\cos (e+f x))}{a f}+\frac {(-d+i c) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*Tan[e + f*x])^3/(a + I*a*Tan[e + f*x]),x]

[Out]

((c^3 - (3*I)*c^2*d + 3*c*d^2 + (3*I)*d^3)*x)/(2*a) + (((3*I)*c - d)*d^2*Log[Cos[e + f*x]])/(a*f) - ((c + (3*I
)*d)*d^2*Tan[e + f*x])/(2*a*f) + ((I*c - d)*(c + d*Tan[e + f*x])^2)/(2*f*(a + I*a*Tan[e + f*x]))

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3550

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((b
*c - a*d)*(c + d*Tan[e + f*x])^(n - 1))/(2*a*f*(a + b*Tan[e + f*x])), x] + Dist[1/(2*a^2), Int[(c + d*Tan[e +
f*x])^(n - 2)*Simp[a*c^2 + a*d^2*(n - 1) - b*c*d*n - d*(a*c*(n - 2) + b*d*n)*Tan[e + f*x], x], x], x] /; FreeQ
[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[n, 1]

Rubi steps

\begin {align*} \int \frac {(c+d \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx &=\frac {(i c-d) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))}+\frac {\int (c+d \tan (e+f x)) \left (a \left (c^2-3 i c d+2 d^2\right )-a (c+3 i d) d \tan (e+f x)\right ) \, dx}{2 a^2}\\ &=\frac {\left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right ) x}{2 a}-\frac {(c+3 i d) d^2 \tan (e+f x)}{2 a f}+\frac {(i c-d) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))}-\frac {\left ((3 i c-d) d^2\right ) \int \tan (e+f x) \, dx}{a}\\ &=\frac {\left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right ) x}{2 a}+\frac {(3 i c-d) d^2 \log (\cos (e+f x))}{a f}-\frac {(c+3 i d) d^2 \tan (e+f x)}{2 a f}+\frac {(i c-d) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 2.84, size = 236, normalized size = 1.83 \[ \frac {\sec (e+f x) (\cos (f x)+i \sin (f x)) \left (2 f x \left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right ) (\cos (e)+i \sin (e))-4 d^2 f x (3 c+i d) (\cos (e)+i \sin (e))+2 i d^2 (3 c+i d) (\cos (e)+i \sin (e)) \log \left (\cos ^2(e+f x)\right )+4 d^2 (3 c+i d) (\cos (e)+i \sin (e)) \tan ^{-1}(\tan (f x))+(c+i d)^3 (\sin (e)+i \cos (e)) \cos (2 f x)+(c+i d)^3 (\cos (e)-i \sin (e)) \sin (2 f x)+4 d^3 (\tan (e)-i) \sin (f x) \sec (e+f x)\right )}{4 f (a+i a \tan (e+f x))} \]

Antiderivative was successfully verified.

[In]

Integrate[(c + d*Tan[e + f*x])^3/(a + I*a*Tan[e + f*x]),x]

[Out]

(Sec[e + f*x]*(Cos[f*x] + I*Sin[f*x])*(-4*(3*c + I*d)*d^2*f*x*(Cos[e] + I*Sin[e]) + 2*(c^3 - (3*I)*c^2*d + 3*c
*d^2 + (3*I)*d^3)*f*x*(Cos[e] + I*Sin[e]) + 4*(3*c + I*d)*d^2*ArcTan[Tan[f*x]]*(Cos[e] + I*Sin[e]) + (2*I)*(3*
c + I*d)*d^2*Log[Cos[e + f*x]^2]*(Cos[e] + I*Sin[e]) + (c + I*d)^3*Cos[2*f*x]*(I*Cos[e] + Sin[e]) + (c + I*d)^
3*(Cos[e] - I*Sin[e])*Sin[2*f*x] + 4*d^3*Sec[e + f*x]*Sin[f*x]*(-I + Tan[e])))/(4*f*(a + I*a*Tan[e + f*x]))

________________________________________________________________________________________

fricas [A]  time = 0.51, size = 202, normalized size = 1.57 \[ \frac {{\left (2 \, c^{3} - 6 i \, c^{2} d + 18 \, c d^{2} + 10 i \, d^{3}\right )} f x e^{\left (4 i \, f x + 4 i \, e\right )} + i \, c^{3} - 3 \, c^{2} d - 3 i \, c d^{2} + d^{3} + {\left (i \, c^{3} - 3 \, c^{2} d - 3 i \, c d^{2} + 9 \, d^{3} + {\left (2 \, c^{3} - 6 i \, c^{2} d + 18 \, c d^{2} + 10 i \, d^{3}\right )} f x\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left ({\left (12 i \, c d^{2} - 4 \, d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (12 i \, c d^{2} - 4 \, d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{4 \, {\left (a f e^{\left (4 i \, f x + 4 i \, e\right )} + a f e^{\left (2 i \, f x + 2 i \, e\right )}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^3/(a+I*a*tan(f*x+e)),x, algorithm="fricas")

[Out]

1/4*((2*c^3 - 6*I*c^2*d + 18*c*d^2 + 10*I*d^3)*f*x*e^(4*I*f*x + 4*I*e) + I*c^3 - 3*c^2*d - 3*I*c*d^2 + d^3 + (
I*c^3 - 3*c^2*d - 3*I*c*d^2 + 9*d^3 + (2*c^3 - 6*I*c^2*d + 18*c*d^2 + 10*I*d^3)*f*x)*e^(2*I*f*x + 2*I*e) + ((1
2*I*c*d^2 - 4*d^3)*e^(4*I*f*x + 4*I*e) + (12*I*c*d^2 - 4*d^3)*e^(2*I*f*x + 2*I*e))*log(e^(2*I*f*x + 2*I*e) + 1
))/(a*f*e^(4*I*f*x + 4*I*e) + a*f*e^(2*I*f*x + 2*I*e))

________________________________________________________________________________________

giac [A]  time = 0.95, size = 186, normalized size = 1.44 \[ -\frac {\frac {4 i \, d^{3} \tan \left (f x + e\right )}{a} - \frac {{\left (i \, c^{3} + 3 \, c^{2} d - 3 i \, c d^{2} - d^{3}\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a} + \frac {{\left (i \, c^{3} + 3 \, c^{2} d + 9 i \, c d^{2} - 5 \, d^{3}\right )} \log \left (-i \, \tan \left (f x + e\right ) - 1\right )}{a} + \frac {-i \, c^{3} \tan \left (f x + e\right ) - 3 \, c^{2} d \tan \left (f x + e\right ) - 9 i \, c d^{2} \tan \left (f x + e\right ) + 5 \, d^{3} \tan \left (f x + e\right ) - 3 \, c^{3} - 3 i \, c^{2} d - 3 \, c d^{2} - 3 i \, d^{3}}{a {\left (\tan \left (f x + e\right ) - i\right )}}}{4 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^3/(a+I*a*tan(f*x+e)),x, algorithm="giac")

[Out]

-1/4*(4*I*d^3*tan(f*x + e)/a - (I*c^3 + 3*c^2*d - 3*I*c*d^2 - d^3)*log(tan(f*x + e) + I)/a + (I*c^3 + 3*c^2*d
+ 9*I*c*d^2 - 5*d^3)*log(-I*tan(f*x + e) - 1)/a + (-I*c^3*tan(f*x + e) - 3*c^2*d*tan(f*x + e) - 9*I*c*d^2*tan(
f*x + e) + 5*d^3*tan(f*x + e) - 3*c^3 - 3*I*c^2*d - 3*c*d^2 - 3*I*d^3)/(a*(tan(f*x + e) - I)))/f

________________________________________________________________________________________

maple [B]  time = 0.19, size = 288, normalized size = 2.23 \[ -\frac {i d^{3} \tan \left (f x +e \right )}{f a}+\frac {3 \ln \left (\tan \left (f x +e \right )+i\right ) c^{2} d}{4 f a}-\frac {\ln \left (\tan \left (f x +e \right )+i\right ) d^{3}}{4 f a}+\frac {i \ln \left (\tan \left (f x +e \right )+i\right ) c^{3}}{4 f a}-\frac {3 i \ln \left (\tan \left (f x +e \right )+i\right ) c \,d^{2}}{4 f a}-\frac {3 \ln \left (\tan \left (f x +e \right )-i\right ) c^{2} d}{4 f a}+\frac {5 \ln \left (\tan \left (f x +e \right )-i\right ) d^{3}}{4 f a}-\frac {i \ln \left (\tan \left (f x +e \right )-i\right ) c^{3}}{4 f a}-\frac {9 i \ln \left (\tan \left (f x +e \right )-i\right ) c \,d^{2}}{4 f a}+\frac {3 i c^{2} d}{2 f a \left (\tan \left (f x +e \right )-i\right )}-\frac {i d^{3}}{2 f a \left (\tan \left (f x +e \right )-i\right )}+\frac {c^{3}}{2 f a \left (\tan \left (f x +e \right )-i\right )}-\frac {3 c \,d^{2}}{2 f a \left (\tan \left (f x +e \right )-i\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*tan(f*x+e))^3/(a+I*a*tan(f*x+e)),x)

[Out]

-I/f/a*d^3*tan(f*x+e)+3/4/f/a*ln(tan(f*x+e)+I)*c^2*d-1/4/f/a*ln(tan(f*x+e)+I)*d^3+1/4*I/f/a*ln(tan(f*x+e)+I)*c
^3-3/4*I/f/a*ln(tan(f*x+e)+I)*c*d^2-3/4/f/a*ln(tan(f*x+e)-I)*c^2*d+5/4/f/a*ln(tan(f*x+e)-I)*d^3-1/4*I/f/a*ln(t
an(f*x+e)-I)*c^3-9/4*I/f/a*ln(tan(f*x+e)-I)*c*d^2+3/2*I/f/a/(tan(f*x+e)-I)*c^2*d-1/2*I/f/a/(tan(f*x+e)-I)*d^3+
1/2/f/a/(tan(f*x+e)-I)*c^3-3/2/f/a/(tan(f*x+e)-I)*c*d^2

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^3/(a+I*a*tan(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

mupad [B]  time = 5.66, size = 175, normalized size = 1.36 \[ -\frac {\frac {3\,c^2\,d-d^3}{2\,a}+\frac {\left (d^3\,1{}\mathrm {i}+3\,c\,d^2\right )\,1{}\mathrm {i}}{2\,a}-\frac {-d^3+c^3\,1{}\mathrm {i}}{2\,a}}{f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}-\frac {d^3\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}{a\,f}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (-c^3\,1{}\mathrm {i}-3\,c^2\,d+c\,d^2\,3{}\mathrm {i}+d^3\right )}{4\,a\,f}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (c^3\,1{}\mathrm {i}+3\,c^2\,d+c\,d^2\,9{}\mathrm {i}-5\,d^3\right )}{4\,a\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*tan(e + f*x))^3/(a + a*tan(e + f*x)*1i),x)

[Out]

- ((3*c^2*d - d^3)/(2*a) + ((3*c*d^2 + d^3*1i)*1i)/(2*a) - (c^3*1i - d^3)/(2*a))/(f*(tan(e + f*x)*1i + 1)) - (
d^3*tan(e + f*x)*1i)/(a*f) - (log(tan(e + f*x) + 1i)*(c*d^2*3i - 3*c^2*d - c^3*1i + d^3))/(4*a*f) - (log(tan(e
 + f*x) - 1i)*(c*d^2*9i + 3*c^2*d + c^3*1i - 5*d^3))/(4*a*f)

________________________________________________________________________________________

sympy [A]  time = 0.86, size = 267, normalized size = 2.07 \[ - \frac {2 d^{3}}{- a f e^{2 i e} e^{2 i f x} - a f} + \begin {cases} - \frac {\left (- i c^{3} + 3 c^{2} d + 3 i c d^{2} - d^{3}\right ) e^{- 2 i e} e^{- 2 i f x}}{4 a f} & \text {for}\: 4 a f e^{2 i e} \neq 0 \\x \left (- \frac {c^{3} - 3 i c^{2} d + 9 c d^{2} + 5 i d^{3}}{2 a} + \frac {i \left (- i c^{3} e^{2 i e} - i c^{3} - 3 c^{2} d e^{2 i e} + 3 c^{2} d - 9 i c d^{2} e^{2 i e} + 3 i c d^{2} + 5 d^{3} e^{2 i e} - d^{3}\right ) e^{- 2 i e}}{2 a}\right ) & \text {otherwise} \end {cases} + \frac {i d^{2} \left (3 c + i d\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} - \frac {x \left (- c^{3} + 3 i c^{2} d - 9 c d^{2} - 5 i d^{3}\right )}{2 a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))**3/(a+I*a*tan(f*x+e)),x)

[Out]

-2*d**3/(-a*f*exp(2*I*e)*exp(2*I*f*x) - a*f) + Piecewise((-(-I*c**3 + 3*c**2*d + 3*I*c*d**2 - d**3)*exp(-2*I*e
)*exp(-2*I*f*x)/(4*a*f), Ne(4*a*f*exp(2*I*e), 0)), (x*(-(c**3 - 3*I*c**2*d + 9*c*d**2 + 5*I*d**3)/(2*a) + I*(-
I*c**3*exp(2*I*e) - I*c**3 - 3*c**2*d*exp(2*I*e) + 3*c**2*d - 9*I*c*d**2*exp(2*I*e) + 3*I*c*d**2 + 5*d**3*exp(
2*I*e) - d**3)*exp(-2*I*e)/(2*a)), True)) + I*d**2*(3*c + I*d)*log(exp(2*I*f*x) + exp(-2*I*e))/(a*f) - x*(-c**
3 + 3*I*c**2*d - 9*c*d**2 - 5*I*d**3)/(2*a)

________________________________________________________________________________________